home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 December / Ahoy_Magazine_86-12_1986_Double_L.d64 / Text Search (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  299b  |  17 lines

  1. 0 rem << cd36-6 >>
  2. 1 rem commodares problem #32-2:
  3. 2 print"[147]           text search"
  4. 3 rem solution by
  5. 4 rem    jason simpson
  6. 5 rem
  7. 10 input"search string";a$
  8. 20 a=len(a$)
  9. 30 open1,8,0,"testfile,s,r"
  10. 40 if st then close1 : end
  11. 50 input#1,b$
  12. 60 b=len(b$)
  13. 70 for y=1 to b
  14. 80 if mid$(b$,y,a)=a$ then print b$: y=b
  15. 90 next y
  16. 100 goto 40
  17.